<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>淘票票影城系统</title>
    <link rel="stylesheet" th:href="@{/css/semantic.min.css}">
    <link rel="stylesheet" th:href="@{/css/admin.css}">
    <script type="text/javascript" th:src="@{/js/jquery-3.4.1.js}"></script>
    <script type="text/javascript" th:src="@{/js/semantic.min.js}"></script>
</head>
<body>
<div class="ui top attached  menu">
    <a class="ui item button"><i class="sidebar icon"></i>菜单 </a>
    <a th:href="@{/admin/logout}" class="right item"><i class="sign-out icon"></i>退出</a>
</div>
<div class="ui  sidebar inverted vertical menu">
    <div class="item">
        <h4 class="ui blue header">影城管理系统</h4>
    </div>
    <a th:href="@{/admin/index}" class="item">首页</a>
    <a th:href="@{/admin/hall}" class="item">影厅管理</a>
    <a th:href="@{/admin/time}" class="active item">排片管理</a>
    <a th:href="@{/admin/cinema}" class="item">影院管理</a>
    <a th:href="@{/admin/orders}" class="item">订单管理</a>
</div>


<div class="ui container">
    <div class="row">
        <h2 class="ui center">排片计划</h2>
    </div>
    <table class="ui compact teal table">
        <thead>
            <th></th>
            <th>影片名称</th>
            <th>影片日期</th>
            <th>影片时期</th>
            <th>影厅名称</th>
            <th>价格</th>
            <th>操作</th>
        </thead>
        <tbody>
            <tr th:each="timeTable,stat:${timeTables}">
                <td th:text="${stat.count}"></td>
                <td th:text="${timeTable.filmName}"></td>
                <td th:text="${timeTable.date}"></td>
                <td th:text="${timeTable.time}"></td>
                <td th:text="${timeTable.hallName}"></td>
                <td th:text="${timeTable.price}"></td>
                <td>
                    <a th:href="@{/admin/time/{id}/delete(id=${timeTable.id})}"
                       class="ui red basic button">删除</a>
                </td>
            </tr>
        </tbody>
        <tfoot>
        <tr>
            <th colspan="7">
                <a  th:href="@{/admin/time/input}"
                    class="ui mini right floated teal basic button">新增</a>
            </th>
        </tr>
        </tfoot>
    </table>
    <div class="ui success message" th:unless="${#strings.isEmpty(message)}">
        <i class="close icon"></i>
        <div class="header">提示：</div>
        <p th:text="${message}">恭喜，操作成功！</p>
    </div>
</div>

<script>
    $(".ui.button").click(function () {
        $(".ui.sidebar")
            .sidebar({
                transition:'slide out'
            })
            .sidebar("toggle");
    });

    //消息提示关闭初始化
    $('.message .close')
        .on('click', function () {
            $(this)
                .closest('.message')
                .transition('fade');
        });
</script>
</body>
</html>